//
//  Configuration.h
//  XiaoHongShu
//
//  Created by Jason on 2022/6/15.
//

#ifndef Configuration_h
#define Configuration_h

//屏幕宽高
#define kSPScreenWidth [[UIScreen mainScreen] bounds].size.width
#define kSPScreenHeight [[UIScreen mainScreen] bounds].size.height
#define kSPAPP ((AppDelegate *)[[UIApplication sharedApplication] delegate])


#pragma mark - 尺寸适配
//---------------模板ID--命名：K+适配(SP）+功能名--------------------------------------------
//#define IS_IPHONE_X ((kSPScreenHeight >= 812.0f) ? true : false)
#define kSPIsiPhone5 ((kSPScreenHeight == 568) ? TRUE:FALSE)
#define kSPIsiPHone4 ((kSPScreenHeight == 480) ? TRUE:FALSE)
#define kSPIsiPHone6 ((kSPScreenHeight == 667) ? TRUE:FALSE)
#define kSPIsiPHone6P ((kSPScreenHeight == 736) ? TRUE:FALSE)
#define kSPIsiPHoneX ((kSPScreenHeight == 812) ? TRUE:FALSE)
#define kSPIsiPHoneXR ((kSPScreenHeight == 896) ? TRUE:FALSE)

#define IS_IPHONE_X ((kSPScreenHeight >= 812.0f) ? true : false)
#define kNavContentBarHeight 44.0f
//#define kStatusBarHeight (IS_IPHONE_X ? 44.0f : 20.0f)
//#define kNavBarHeight (IS_IPHONE_X ? 88.0f : 64.0f)
//#define kTabBarHeight (IS_IPHONE_X ? 83.0f : 49.0f)

// RGB
#define kRGBColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define kRGBAlphaColor(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]
//31,178,240
#define kRGBHex(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define kRGBHexAlpha(rgbValue, a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)]

//颜色
#define kWhiteColor [UIColor whiteColor]
#define kRedColor [UIColor redColor]
#define kYellowColor [UIColor yellowColor]
#define kLightGrayColor [UIColor lightGrayColor]
#define kDarkGrayColor [UIColor darkGrayColor]
#define kPurpleColor [UIColor purpleColor]
#define kOrangeColor [UIColor orangeColor]
#define kGreenColor [UIColor greenColor]
#define kBlueColor [UIColor blueColor]
#define kBlackColor [UIColor blackColor]
#define kClearColor [UIColor clearColor]

//字体大小
#define kFont(fontSize) [UIFont systemFontOfSize:fontSize]
#define kBoldFont(fontSize) [UIFont boldSystemFontOfSize:fontSize]

// 获取APP版本号
#define kAppVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
// UUID
#define hUUID [[NSUserDefaults standardUserDefaults] valueForKey:@"UUID"]

#pragma mark - Simplify basic functions
//获取APP名称
#define kAppName [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"]

//获取图片名称
#define kImageName(imageName) [UIImage imageNamed:imageName]

//下拉刷新和上拉加载
typedef NS_ENUM(NSInteger, MJRefreshType) {
    MJRefreshTypePullUp = 0,    // 上拉加载
    MJRefreshTypePullDown = 1   // 下拉刷新
};

//设置滑块滑动的状态
typedef NS_ENUM(NSUInteger, BNCommonGestureState) {
    BNCommonGestureStateUnKnown,
    BNCommonGestureStateBegin,
    BNCommonGestureStateMove,
    BNCommonGestureStateEnd,
};

#endif /* Configuration_h */
